package com.zhang.springcloud.controller;

import com.zhang.springcloud.config.ConfigOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ConsumerController {
    @Autowired
    private RestTemplate restTemplate;
    @Value("${service-url.nacos-user-service}")
    private String Service_Name;
    @GetMapping("/consumer/payment/nacos/{id}")
    public String get(@PathVariable("id") Integer id){
        return restTemplate.getForObject(Service_Name+"/payment/nacos/"+id,String.class);
    }
}
